package com.xyzpool.test;
import java.util.ArrayList;
import java.util.List;


public class ListToArrayTestor {
	public static void main(String[] args) {
		Integer[] a = new Integer[]{1,2,3,4,5};
		List<Integer> list = new ArrayList<Integer>();
		list.add(1);
		list.toArray(a);
		for (int i = 0; i < a.length; i++) {
			System.out.println(a[i]+",");
		}
		Integer[] b = new Integer[]{1,2,3,4};
		list.add(new Integer(1));
		b = list.toArray(new Integer[0]);
		System.out.println("B:"+list.size()+",list capacity");
		for (int i = 0; i < b.length; i++) {
			System.out.println(b[i]+",");
		}
	}
}
